<%@page import="lab.bmp.genre.GenrePK"%>
<%@page import="lab.bmp.tag.Tag"%>
<%@page import="java.util.*"%>
<%@page extends="lab.jsp.Tags" errorPage="error_page.jsp"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%

    Collection<Tag> tags = getData();

%>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <a href="index.jsp">to main</a><br>
        <h2>Tags</h2>
        <i>You can't edit this.</i>
        <table>
            <tr><td>Tag Number</td><td>Name</td></tr>
            <%
            
                Iterator<Tag> iter = tags.iterator();
                int number = 1;
                while (iter.hasNext()) {
                    Tag tag = iter.next();
                    
            %>
            <tr><td><%=tag.getId()%>.</td><td><%=dao.findGenre(new GenrePK(tag.getGenre().getId())).getName()%></td></tr>
            <%
                number++; }
            %>
        </table>
        <% if (tags.isEmpty()) { %>
        <p><b>No tags found.</b>
        <% } %>
    </body>
</html>
